package com.shushan.pages.bean;

import com.android.net.bean.NetBaseBean;
import com.shushan.base.Constants;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: ExerciseRecordTotalBean
 * @Desciption: //练习记录列表页总数据bean
 * @author: zhangshihao
 * @date: 2018-04-23
 */
public class ExerciseRecordTotalBean extends NetBaseBean {

    public ExerciseRecordListBean syncListBean;
    public ExerciseRecordListBean smartListBean;
    public ExerciseRecordListBean learnByDoListBean;
    public ExerciseRecordListBean keyPointListBean;
    public ExerciseRecordListBean difficultListBean;
    public ExerciseRecordListBean easyWrongListBean;
    public ExerciseRecordListBean specialListBean;

    public ExerciseRecordListBean strangeWordsListBean;
    public ExerciseRecordListBean speakingListBean;
    public ExerciseRecordListBean englishWordsListBean;
    public ExerciseRecordListBean hearingListBean;
    public ExerciseRecordListBean readReciteListBean;
    public ExerciseRecordListBean oralCalculateListBean;

    public List<ExerciseRecordListBean> exerciseRecordListBeans;

    @Override
    public void initByJson(JSONObject jsonObject) throws JSONException {
        if(jsonObject != null){
            exerciseRecordListBeans = new ArrayList<>();

            syncListBean = new ExerciseRecordListBean();
            syncListBean.type = Constants.TYPE_SYNC_EXERCISE;
            syncListBean.initByJson(jsonObject.optJSONObject(Constants.SYNC_EXERCISE));

            smartListBean = new ExerciseRecordListBean();
            smartListBean.type = Constants.TYPE_SMART_EXERCISE;
            smartListBean.initByJson(jsonObject.optJSONObject(Constants.SMART_EXERCISE));

            learnByDoListBean = new ExerciseRecordListBean();
            learnByDoListBean.type = Constants.TYPE_LEARN_BY_DO;
            learnByDoListBean.initByJson(jsonObject.optJSONObject(Constants.LEARN_BY_DO));

            keyPointListBean = new ExerciseRecordListBean();
            keyPointListBean.type = Constants.TYPE_KEY_POINT_EXERCISE;
            keyPointListBean.initByJson(jsonObject.optJSONObject(Constants.KEY_POINT_EXERCISE));

            difficultListBean = new ExerciseRecordListBean();
            difficultListBean.type = Constants.TYPE_DIFFICULT_POINT_EXERCISE;
            difficultListBean.initByJson(jsonObject.optJSONObject(Constants.DIFFICULT_POINT_EXERCISE));

            easyWrongListBean = new ExerciseRecordListBean();
            easyWrongListBean.type = Constants.TYPE_EASY_WRONG_EXERCISE;
            easyWrongListBean.initByJson(jsonObject.optJSONObject(Constants.EASY_WRONG_EXERCISE));

            specialListBean = new ExerciseRecordListBean();
            specialListBean.type = Constants.TYPE_SPECIAL_TOPIC_EXERCISE;
            specialListBean.initByJson(jsonObject.optJSONObject(Constants.SPECIAL_TOPIC_EXERCISE));

            strangeWordsListBean = new ExerciseRecordListBean();
            strangeWordsListBean.type = Constants.TYPE_STRANGE_WORDS_EXERCISE;
            strangeWordsListBean.initByJson(jsonObject.optJSONObject(Constants.STRANGE_WORDS_EXERCISE));

            speakingListBean = new ExerciseRecordListBean();
            speakingListBean.type = Constants.TYPE_SPEAKING_EXERCISE;
            speakingListBean.initByJson(jsonObject.optJSONObject(Constants.SPEAKING_EXERCISE));

            englishWordsListBean = new ExerciseRecordListBean();
            englishWordsListBean.type = Constants.TYPE_ENGLISH_WORDS_EXERCISE;
            englishWordsListBean.initByJson(jsonObject.optJSONObject(Constants.ENGLISH_WORDS_EXERCISE));

            hearingListBean = new ExerciseRecordListBean();
            hearingListBean.type = Constants.TYPE_HEARING_EXERCISE;
            hearingListBean.initByJson(jsonObject.optJSONObject(Constants.HEARING_EXERCISE));

            readReciteListBean = new ExerciseRecordListBean();
            readReciteListBean.type = Constants.TYPE_READ_RECITE_EXERCISE;
            readReciteListBean.initByJson(jsonObject.optJSONObject(Constants.READ_RECITE_EXERCISE));

            oralCalculateListBean = new ExerciseRecordListBean();
            oralCalculateListBean.type = Constants.TYPE_ORAL_CALCULATE_EXERCISE;
            oralCalculateListBean.initByJson(jsonObject.optJSONObject(Constants.ORAL_CALCULATE_EXERCISE));

            exerciseRecordListBeans.add(syncListBean);
            exerciseRecordListBeans.add(smartListBean);
            exerciseRecordListBeans.add(learnByDoListBean);
            exerciseRecordListBeans.add(keyPointListBean);
            exerciseRecordListBeans.add(difficultListBean);
            exerciseRecordListBeans.add(easyWrongListBean);
            exerciseRecordListBeans.add(specialListBean);

            exerciseRecordListBeans.add(strangeWordsListBean);
            exerciseRecordListBeans.add(speakingListBean);
            exerciseRecordListBeans.add(englishWordsListBean);
            exerciseRecordListBeans.add(hearingListBean);
            exerciseRecordListBeans.add(readReciteListBean);
            exerciseRecordListBeans.add(oralCalculateListBean);
        }
    }
}
